/*
 * File:   person.h
 * Author: Joni
 */
#ifndef PERSON_H
#define PERSON_H
#include "date.h"
#include "relation.h"

struct dynarray;

typedef struct person {
    wchar_t* name;
    struct dynarray* relations;
    wchar_t gender;
    date birthdate;
    date deathdate;
} person;

_Bool per_add_relation(struct person* person1, struct person* person2, enum rel_type type);

_Bool per_add_child(struct person* parent1, struct person* parent2, struct person* child);

_Bool per_add_child_singleparent(struct person* parent, struct person* child);

_Bool per_remove_relation(struct relation* relation);

struct dynarray* per_get_parents(struct person* child);

struct dynarray* per_get_children(struct person* parent);

struct dynarray* per_get_partner(struct person* person);

struct dynarray* per_get_other_rel(struct person* person);

int per_compare(void* person1, void* person2);

void per_free(struct person* person);

struct dynarray* per_get_offspring(person* person, struct dynarray * offspring);

struct dynarray* per_get_ancestor(person* person, struct dynarray * ancestor);

void per_set_deathday(person* person, date deathdate);

void per_set_birthday(person* person, date birthdate);

_Bool per_has_relation(person* per, relation* r);
#endif /* PERSON_H */
